<!DOCTYPE HTML>
<html>
<head>
    <title>请假单</title>
    <meta charset="UTF-8"/>
    
 		      <script type="text/javascript"   th:src="@{/js/jquery.min.js}"></script>
    
   
</head>

<body>
	<div>
	
		<div id="haveOrNo">
		
			<p>没有任何请假单</p>
		</div>
	
		 <div id="xs">
   
		   		<p>请假单</p>
		   		
		   		<p>请假单ID:</p><input type="text" id="id" name="id"/> 
		   		<p>状态:</p><input type="text" id="status" /> 
		   		<p>备注:</p><input type="text" id="msg" /> 
		   		<p>用户ID:</p><input type="text" id="userId" /> 
		   		<p>请假天数:</p><input type="text" id="days" /> 
  		</div>
  		
  		<div style="margin-top:50px;">
  				<input type="button" value="新建请假单" onclick="dianji();"></input>
  		</div>
  		
  		
  		<div id="tj">
   
			<form action="/workflow/initTask" method="post">
		   		<p>备注:</p><input type="text" name="msg" /> 
		   		<p>请假天数:</p><input type="text" name="days" /> 
				<input type="submit" name="提交"/>
			</form>

  		</div>
  		
  		
  		
	</div>
     <script  th:inline="javascript">
    	var id = [[${id}]];
    	var msg = [[${msg}]];
    	var days = [[${days}]];
    	var status = [[${status}]];
    	var userId = [[${userId}]];
    	console.log(id);
    	
    	$("#id").attr("value", id);
    	$("#userId").val(userId);
    	$("#days").val(days);
    	$("#status").val(status);
    	$("#msg").val(msg);
    	
    	//页面加载后先隐藏提交div
    	 $(function () { 
    		 if(id == null){
    			 $("#xs").hide(); 
    			 $("#haveOrNo").show();
    		 }else{
    			$("#haveOrNo").hide();
    		 }
    		$("#tj").hide();
    		
    	 });
    	/*点击新建请假单，把显示请假单div隐藏  */
    	 function dianji(){
    		$("#xs").hide(); 
    		 $("#tj").show(); 
     	}
    </script>
</body>



</html>